<?php
    require_once 'core/config.php';
    require_once 'core/string_helper.php';
    require_once 'core/url_helper.php';
    require_once 'core/loader.php';
    require_once 'core/file_helper.php';
    $id = $_GET['id'];

    if (empty($id)) {
        echo "No id passed!";
    }
    
    $model = load_model('crash_model');
    
    $crash = $model->get_by_id($id);

    $download_file_name = "CrashReport_".$crash['id'].".txt";
    $data = $crash['crash_report'];
    force_download($download_file_name, $data);
?>
